package jspSamples.unit5.javaBeanSamples;

public class _5_8Convert {
    /**
     * 将数组转换为字符串
     * @param arr 数组
     * @return 字符串
     */
    public String arr2Str(String[] arr) {
        StringBuffer sb = new StringBuffer();
        if(arr != null && arr.length>0){
            for(String s:arr){
                sb.append(s);
                sb.append(",");
            }
            if(sb.length()>0){
                sb.deleteCharAt(sb.length()-1);
            }
        }
        return sb.toString();
    }
}
